<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(){
            var num = 10;

            function fun(){
                console.log(num);
            }
            return fun;
        }

        var f = fn();
    </script>
    <!-- 全局作用域下可以访问函数内部的变量 -->
    
</body>
</html>